}
static void
-gtk_css_ruleset_add (GtkCssRuleset *ruleset,
- GParamSpec *pspec,
- GValue *value)
+gtk_css_ruleset_add (GtkCssRuleset *ruleset,
+ const GtkStyleProperty *prop,
+ GValue *value)
{
if (ruleset->style == NULL)
ruleset->style = g_hash_table_new_full (g_direct_hash,
NULL,
(GDestroyNotify) property_value_free);
- ruleset->has_inherit |= gtk_style_param_get_inherit (pspec);
- g_hash_table_insert (ruleset->style, pspec, value);
+ ruleset->has_inherit |= gtk_style_param_get_inherit (prop->pspec);
+ g_hash_table_insert (ruleset->style, (gpointer) prop, value);
}
static gboolean
while (g_hash_table_iter_next (&iter, &key, &value))
{
- GParamSpec *pspec = key;
+ GtkStyleProperty *prop = key;
- if (l != length && !gtk_style_param_get_inherit (pspec))
+ if (l != length && !gtk_style_param_get_inherit (prop->pspec))
continue;
- _gtk_style_properties_set_property_by_pspec (props,
- pspec,
- _gtk_css_selector_get_state_flags (ruleset->selector),
- value);
+ _gtk_style_properties_set_property_by_property (props,
+ prop,
+ _gtk_css_selector_get_state_flags (ruleset->selector),
+ value);
}
}
}
* to override other style providers when merged
*/
g_param_value_set_default (property->pspec, val);
- gtk_css_ruleset_add (ruleset, property->pspec, val);
+ gtk_css_ruleset_add (ruleset, property, val);
}
else if (property->parse_func)
{
}
if ((*property->parse_func) (value_str, val, &error))
- gtk_css_ruleset_add (ruleset, property->pspec, val);
+ gtk_css_ruleset_add (ruleset, property, val);
else
gtk_css_provider_take_error (scanner->provider, scanner, error);
_gtk_css_parser_begins_with (scanner->parser, '}') ||
_gtk_css_parser_is_eof (scanner->parser))
{
- gtk_css_ruleset_add (ruleset, property->pspec, val);
+ gtk_css_ruleset_add (ruleset, property, val);
}
else
{
}
static int
-compare_pspecs (gconstpointer a, gconstpointer b)
+compare_properties (gconstpointer a, gconstpointer b)
{
- return strcmp (((const GParamSpec *) a)->name, ((const GParamSpec *) b)->name);
+ return strcmp (((const GtkStyleProperty *) a)->pspec->name,
+ ((const GtkStyleProperty *) b)->pspec->name);
}
static void
{
keys = g_hash_table_get_keys (ruleset->style);
/* so the output is identical for identical selector styles */
- keys = g_list_sort (keys, compare_pspecs);
+ keys = g_list_sort (keys, compare_properties);
for (walk = keys; walk; walk = walk->next)
{
- GParamSpec *pspec = walk->data;
- const GValue *value = g_hash_table_lookup (ruleset->style, pspec);
+ GtkStyleProperty *prop = walk->data;
+ const GValue *value = g_hash_table_lookup (ruleset->style, prop);
g_string_append (str, " ");
- g_string_append (str, pspec->name);
+ g_string_append (str, prop->pspec->name);
g_string_append (str, ": ");
s = _gtk_css_value_to_string (value);
g_string_append (str, s);
}
void
-_gtk_style_properties_set_property_by_pspec (GtkStyleProperties *props,
- GParamSpec *pspec,
- GtkStateFlags state,
- const GValue *value)
+_gtk_style_properties_set_property_by_property (GtkStyleProperties *props,
+ const GtkStyleProperty *style_prop,
+ GtkStateFlags state,
+ const GValue *value)
{
GtkStylePropertiesPrivate *priv;
PropertyData *prop;
value_type = G_VALUE_TYPE (value);
- if (pspec->value_type == GDK_TYPE_RGBA ||
- pspec->value_type == GDK_TYPE_COLOR)
+ if (style_prop->pspec->value_type == GDK_TYPE_RGBA ||
+ style_prop->pspec->value_type == GDK_TYPE_COLOR)
{
/* Allow GtkSymbolicColor as well */
g_return_if_fail (value_type == GDK_TYPE_RGBA ||
value_type == GDK_TYPE_COLOR ||
value_type == GTK_TYPE_SYMBOLIC_COLOR);
}
- else if (pspec->value_type == CAIRO_GOBJECT_TYPE_PATTERN)
+ else if (style_prop->pspec->value_type == CAIRO_GOBJECT_TYPE_PATTERN)
{
/* Allow GtkGradient as a substitute */
g_return_if_fail (value_type == CAIRO_GOBJECT_TYPE_PATTERN ||
value_type == GTK_TYPE_GRADIENT);
}
else
- g_return_if_fail (pspec->value_type == value_type);
+ g_return_if_fail (style_prop->pspec->value_type == value_type);
priv = props->priv;
- prop = g_hash_table_lookup (priv->properties, pspec);
+ prop = g_hash_table_lookup (priv->properties, style_prop->pspec);
if (!prop)
{
prop = property_data_new ();
- g_hash_table_insert (priv->properties, pspec, prop);
+ g_hash_table_insert (priv->properties, style_prop->pspec, prop);
}
val = property_data_get_value (prop, state);
}
g_value_copy (value, val);
- if (pspec->value_type == value_type)
- g_param_value_validate (pspec, val);
+ if (style_prop->pspec->value_type == value_type)
+ g_param_value_validate (style_prop->pspec, val);
}
/**
return;
}
- _gtk_style_properties_set_property_by_pspec (props,
- node->pspec,
- state,
- value);
+ _gtk_style_properties_set_property_by_property (props,
+ node,
+ state,
+ value);
}
/**